﻿@using Xproject.Util;
@using Model.Util.DTO;
@using Model.Util;
@{
    Layout = null;
    string Domain = CommonHelper.GetAppSettings("Domin");
}
@model AttributeValueListModel
<!DOCTYPE html>

<html>

<head>
    <title>属性值列表</title>
    <link href="~/Content/categoryCss/site.css" rel="stylesheet" />
    <script src="~/Scripts/jquery-1.10.2.js"></script>
    <script src="~/Scripts/layer/layer.js"></script>
    <script type="text/javascript">
        function DelAttrValue(obj, attrValueId) {
            layer.confirm('确认删除此属性值？', {
                btn: ['确认', '取消'] //按钮
            }, function () {

                    $.ajax({
                         url: "@(Domain+ "/Category/DelAttributeValue")",
                    type: 'post',
                    cache: 'false',
                    async: 'false',
                    data: { attrValueId: attrValueId },
                    success: function (data) {
                        if (data.Success == true) {
                            layer.alert('删除成功', { icon: 1, skin: 'layer-ext-moon', time: 2000 });
                          
                            $(obj).parent().parent().remove();
                        } else {
                            layer.alert('删除失败', { icon: 1, skin: 'layer-ext-moon', time: 2000 });
                        }
                           },
                    error: function (XMLHttpRequest, textStatus, errorThrown) {

                        }
                    });


                }, function () {
                    layer.closeAll('dialog');
                }
               );

        }
    </script>
</head>
<body>
    <h1 class="rightH1">
        属性值管理 &gt;&gt; 属性值列表
        <div class="right">
            <a href="@Url.Action("CategoryList")" class="menuBT"><img src="../../content/images/goback.jpg" />返回分类</a>
            <a href="@Url.Action("AttributeList", new { cateId = Model.CateId })" class="menuBT"><img src="../../content/images/goback.jpg" />返回属性列表</a>
            <a href="@Url.Action("AddattributeValue", new { AttrId = Model.AttrId })" class="menuBT"><img src="../../content/images/add.jpg" />添加属性值</a>
            <div class="clear">
            </div>
        </div>
        <div class="clear">
        </div>
    </h1>
    <div class="table_top">
    </div>
    <div class="dataList">
        <table width="100%">
            <thead>
                <tr>
                    <th width="10" align="center">
                    </th>
                    <th width="80" align="left">
                        编号
                    </th>
                    <th align="left">
                        属性值
                    </th>
                    <th width="250" align="left">
                        所属属性
                    </th>
                    <th width="100" align="left">
                        排序
                    </th>
                    <th width="100" align="left">
                        管理操作
                    </th>
                </tr>
            </thead>
            <tbody>
                @foreach (CategoryAttrValues info in Model.AttributeValueList)
                {
                    <tr>
                        <td align="center"></td>
                        <td>@info.AttrValueId</td>
                        <td>@info.AttrValue</td>
                        <td>@Model.AttributeName</td>
                        <td>@info.AttrValueDisplayOrder</td>
                        <td>
                            @Html.ActionLink("[编辑]", "editattributevalue", new { attrValueId = info.AttrValueId }, new { @class = "editOperate" })|
                            <a href="#" onclick="DelAttrValue(this,'@info.AttrValueId')" class="deleteOperate">[删除]</a>                            
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <div class="table_bottom">
    </div>
</body>
</html>
